package com.hoshiicloud.elasticsearch.entity;


import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * SPU
 * </p>
 *
 * @author ygd
 * @since 2019-06-04
 */
@Data
@Document(indexName = "spu",type = "spu")
public class Spu implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private Long id;

    /**
     * spu id
     */
    private Long baseSpuId;


    /**
     * 租户ID
     */
    private Long companyId;

    /**
     * 平台ID
     */
    private Long platformId;

    /**
     * 店铺ID
     */
    private Long storeId;

    /**
     * 上级店铺ID
     */
    private Long parentStoreId;

    /**
     * skuId
     */
    private Long skuId;

    /**
     * baseSkuId
     */
    private Long baseSkuId;

    /**
     * 提货时间间隔
     */
    private Integer  receiptInterval;

    /**
     * 提货时间
     */
    private LocalDateTime receiptDate;

    /**
     * 标题
     */
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String title;

    /**
     * 商品主图
     */
    private String spuImage;

    /**
     * 排序权重
     */
    private Long weight;

    /**
     * 售价
     */
    private BigDecimal salePrice;

    /**
     * 市场价
     */
    private BigDecimal maketPrice;

    /**
     * spu营销类目ID
     */
    private Long salesCategoryId;

    /**
     * 是否分销商,0 否 1是
     */
    private Integer isDistributor;

}
